/*
 * This file is part of JContextFree.
 *
 * JContextFree is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JContextFree is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JContextFree.  If not, see <http://www.gnu.org/licenses/>.
 */

package it.enricod.jcontextfree.gui.impl;

import it.enricod.jcontextfree.gui.IProgramCodePanel;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class ProgramCodePanel implements IProgramCodePanel {

	private JPanel panel;
	private JTextArea textArea;

	public ProgramCodePanel() {
		initGui();
	}

	private void initGui() {
		panel = new JPanel();
		textArea = new JTextArea();
		textArea.setColumns(25);
		textArea.setRows(50);
		textArea.setText("");
		panel.add(new JScrollPane(textArea));
	}

	public JPanel getPanel() {
		return panel;
	}

	public String getProgramAsText() {
		return textArea.getText();
	}

	public void setProgramAsText(String text) {
		textArea.setText(text);
	}
}
